Project Summary: The cortex must both track and process dynamically changing environments as well as store and combine diverse inputs to generate complex behavior. Further, the neuronal circuits that accomplish this must be malleable to changing contexts, such as during attention related tasks. Charged with these tasks it is perhaps unsurprising that the response dynamics of populations of cortical neurons is then dauntingly complex. Currently, we lack a deep understanding of the circuit mechanics that underlie the rich dynamics exhibited in the nervous system. This omission is particularly serious given the ever increasing breadth of data showing that neuronal dynamics, and its variability, is context- dependent and shared across large regions of the brain. Our proposal seeks to address several fundamental issues facing current network models. Namely, spiking network models with balanced excitation and inhibition are not currently capable of generating realistic transient activity, steady state activity, and neural variability within a single model. To address these shortcomings, we will develop an automated method for optimizing the parameters of network models. We will then validate the optimization method and resulting network models by comparing the population activity generated by the network models with that recorded in macaque visual area V4 and prefrontal cortex during discrimination and working memory tasks. To perform this comparison, it is a fruitless exercise to attempt to correspond each recorded neuron to a neuron in the network model. Instead, a key innovation of our proposal is that we will compare the low-dimensional representations of the population activity in the network model and the real data. The network models and optimization method that we build will be will be widely shared with the research community. If successful, the work proposed here will lead to a vastly deeper understanding of how neural circuits give rise to transient activity, steady-state activity, and neural variability, and equip the research community with the tools to make further discoveries in this direction.